import { AcGameObject } from '/static/js/ac_game_object/base.js';
import { Controller } from '/static/js/controller/base.js';


export class GameMap extends AcGameObject {
    constructor(root) {
        super();

        this.root = root;
        this.$canvas = $('<canvas width="1280" height="720" tabindex=0></canvas>');
        this.ctx = this.$canvas[0].getContext('2d');

        // var ctx = document.getElementById("myCanvas");
        // ctx.strokeRect(0, -20, 20, 30);
        // ctx.strokeStyle = "black";

        this.root.$kof.append(this.$canvas);
        this.$canvas.focus();

        // this.ctx.strokeStyle = "green";
        // this.ctx.strokeRect(20, 10, 160, 100);

        this.controller = new Controller(this.$canvas);

        this.root.$kof.append($(`<div class="kof-head">
        <div class="kof-head-hp-0"><div><div></div></div></div>
    </div>`));
    }

    start() {

    }

    update() {
        this.render();
    }

    render() {
        this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
    }
}
